package com.bwie.system.bloom;

import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.nio.charset.Charset;

@Component
public class BloomFilterGoods {
    @Bean
    public BloomFilter<String> bloomFilter(){
        Charset charset = Charset.forName("utf-8");
        BloomFilter<String> bloomFilter = BloomFilter.create(Funnels.stringFunnel(charset), 10000000, 0.01);
        return bloomFilter;
    }
}
